package org.csu.mall.common;

import com.google.common.collect.Sets;

import java.util.Set;

public class CONSTANT {

    public static final String LOGIN_USER = "loginUser";

    public static final String USERNAME = "username";

    public static final String EMAIL = "email";

    public static final String PHONE_NUMBER = "phone_number";

    public static final String ALL_CATEGORY = "CSU_MALL";

    public static final String IMAGE_HOST = "image_host";

    public interface Role{
        int ADMIN = 0; //后台管理用户
        int CUSTOMER = 1; //前台普通用户
        int AUTHENTICATION = 2;//前台实名认证用户
        int ONLINE_ADMIN = 3;//在线用户
        int ALL = 4; //所有用户
    }

    public interface CommodityListOrderBy{
        Set<String> PRICE_ASC_DESC = Sets.newHashSet("price_desc", "price_asc", "star_asc", "star_desc");
    }

    public interface Payment{
        int OFFLINE_PAY = 0; //线下支付，个人交易
        int ONLINE_PAY = 1; //线上支付
    }

    public enum CommodityStatus{

        NO_SALE(0, "未售"),
        OUT_SALE(1, "售空"),
        ON_SALE(2, "在售"),
        HOT_SALE(3, "热售"),
        PROMOTION_SALE(4, "打折促销");

        private int code;

        private String description;

        CommodityStatus(int code, String description){
            this.code = code;
            this.description = description;
        }

        public int getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }
    }

    public enum CommoditySource{
        OFFICIAL_SALE(0, "官方"),
        PERSONAL_SALE(1, "私人"),
        ALL_SALE(2, "所有");

        private int code;

        private String description;

        CommoditySource(int code, String description){
            this.code = code;
            this.description = description;
        }

        public int getCode(){
            return code;
        }

        public String getDescription(){
            return description;
        }
    }

    public enum CategoryStatus{

        NO_CANCEL(0, "未取消"),
        CANCEL(1, "已取消");

        private int code;

        private String description;

        CategoryStatus(int code, String description){
            this.code = code;
            this.description = description;
        }

        public int getCode(){
            return code;
        }

        public String getDescription(){
            return description;
        }
    }

    public enum MerchantOrderStatus{

        ORDER_ON_SALE(0, "正在售卖"),
        ORDER_OUT_SALE(1, "已售空"),
        ORDER_CANCEL_SALE(2, "取消售卖");

        private int code;

        private String description;

        MerchantOrderStatus(int code, String description){
            this.code = code;
            this.description = description;
        }

        public int getCode(){
            return code;
        }

        public String getDescription(){
            return description;
        }
    }

    public enum CustomerOrderStatus{

        UNPAID(0, "待支付"),
        CANCEL_ORDER(1, "取消订单"),
        PAID_UNCONFIRMED(2, "已支付待确认收货"),
        CONFIRM_NO_EVALUATION(3, "确认收货未评价"),
        EVALUATION_ORDER(4, "已评价"),
        ORDER_NOT_DELIVERY(0, "未发货"),
        ORDER_DELIVERY(1, "已发货"),
        ORDER_REJECT(2,"订单回绝");

        private int code;

        private String description;

        CustomerOrderStatus(int code, String description){
            this.code = code;
            this.description = description;
        }

        public int getCode(){
            return code;
        }

        public String getDescription(){
            return description;
        }
    }

    public enum CartCommodityStatus{

        CHECKED(0, "选中"),
        UNCHECKED(1, "未选中");

        private int code;

        private String description;

        CartCommodityStatus(int code, String description){
            this.code = code;
            this.description = description;
        }

        public int getCode(){
            return code;
        }

        public String getDescription(){
            return description;
        }
    }

    public interface Cart{
        int LIMIT_NUM_SUCCESS = 0;//购买数量小于库存
        int LIMIT_NUM_FAILURE = 1;//购买数量大于库存
    }
}
